﻿using Microsoft.Xna.Framework;
using System.Windows.Forms;
using System;
using Microsoft.Xna.Framework.Graphics;
using System.Drawing;

namespace BicycleTrafficSimulator
{
    class EditorControls
    {
        Button quitButton = new Button();

        public Button QuitButton
        {
            get { return quitButton; }
            set { quitButton = value; }
        }

        public Scene scene;

        public EditorControls(Scene _scene)
        {
            scene = _scene;
        }

        Form windowsGameForm;

        public void Initialize()
        {
            windowsGameForm = Control.FromHandle(scene.Window.Handle) as Form;
            InitializeComponent();
        }

        void InitializeComponent()
        {

            quitButton.Size = new Size(150, 50);
            quitButton.Location = new System.Drawing.Point(1200, 10);
            quitButton.Text = "Quit";
            quitButton.Font = new Font(quitButton.Font.FontFamily, 10, quitButton.Font.Style | FontStyle.Bold);
            quitButton.BackColor = System.Drawing.Color.SteelBlue;
            windowsGameForm.Controls.Add(quitButton);
            quitButton.Click += new System.EventHandler(this.quitButton_Click);

        }

        private void quitButton_Click(object sender, EventArgs e)
        {
            scene.gameState = Scene.GameState.Finished;
            quitButton.Dispose();
        }
    }
}
